package com.yfbao.horizon.model;

public class SingleResponse<T> extends BaseResponse{
    private static final long serialVersionUID = -7914940743622178880L;
    private SingleData<T> data;

    public SingleResponse() {
    }

    public static <T> SingleResponse<T> from(T dto) {
        SingleResponse response = new SingleResponse();
        response.setData(SingleData.from(dto));
        return response;
    }

    public static <T> SingleResponse<T> ok() {
        SingleResponse response = new SingleResponse();
        response.setData((SingleData)null);
        return response;
    }

    public static SingleResponse buildProcessingResponse() {
        SingleResponse response = new SingleResponse();
        response.setStatus(-1);
        return response;
    }

    public SingleData<T> getData() {
        return this.data;
    }

    public void setData(SingleData<T> data) {
        this.data = data;
    }
}
